/**
 * Copyright (c) 2017-2017 All Rights Reserved.
 */
package com.zbest.zpay.exchange.biz.action.pay;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zbest.zpay.exchange.dal.dao.FluxInfoDAO;
import com.zbest.zpay.exchange.dal.model.FluxInfoDO;
import com.zbest.zpay.exchange.helper.StatusManager;
import com.zbest.zpay.service.exchange.model.FluxInfoStatus;
import com.zbest.zpay.service.exchange.model.FluxKeyEnum;
import com.zbest.zpay.shared.process.BaseAction;
import com.zbest.zpay.shared.process.ProcessResult;

/**
 * 
 *
 * @author Administrator
 * @version $Id: UpdateToPRAction.java, v 0.1 2017-4-16 下午1:47:32 Administrator Exp $
 */
@Service("updateToFGAction")
public class UpdateToFGAction extends BaseAction {

    @Resource
    private FluxInfoDAO   fluxInfoDAO;

    @Resource
    private StatusManager fluxInfoStatusManager;

    /** 
     * @see com.zbest.zpay.shared.process.BaseAction#perform(com.zbest.zpay.shared.process.ProcessResult)
     */
    @Override
    public void perform(ProcessResult processResponse) {

        FluxInfoDO fluxInfoDO = getValue(FluxKeyEnum.FLUX_INFO_DO.getCode());

        fluxInfoStatusManager.statusCheck(FluxInfoStatus.INITIAL.getCode(),
            FluxInfoStatus.FORMGEN.getCode());
        fluxInfoDAO.update(fluxInfoDO.getFluxId(), FluxInfoStatus.FORMGEN.getCode(),
            FluxInfoStatus.INITIAL.getCode());
    }

}
